{extend name='public/base' /}

{block name="content"}

<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-body" style="padding: 15px;">
            <form class="layui-form" action="" lay-filter="form">
                <input type="hidden" name="id" value="{$info.id}">
                <div class="layui-form-item">
                    <label class="layui-form-label">订单编号</label>
                    <div class="layui-input-block">
                        <input type="text" name="order_sn" disabled value="{$info.order_sn}" autocomplete="off"
                               placeholder="请输入需缴金额" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">合同号</label>
                    <div class="layui-input-block">
                        <input type="text" name="contract_code" disabled value="{$info.contract_code}" autocomplete="off"
                               placeholder="请输入需缴金额" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">商户名称</label>
                    <div class="layui-input-block">
                        <input type="text" name="company" disabled value="{$info.merchants.name}" autocomplete="off"
                               placeholder="请输入需缴金额" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">缴费区间</label>
                    <div class="layui-input-block">
                        <input type="text" disabled value="{$info.start_time}~{$info.end_time}" autocomplete="off"
                               placeholder="请输入需缴金额" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">创建时间</label>
                    <div class="layui-input-block">
                        <input type="text" value="{$info.create_time}" autocomplete="off" disabled placeholder=""
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">缴费类型</label>
                    <div class="layui-input-block">
                        <input type="text" name="pay_amount" disabled value="{$info.costType.cost_name}"
                               autocomplete="off" placeholder="请输入需缴金额" class="layui-input">
                    </div>
                </div>

                {if condition="$info['pay_status'] eq 1"}
                <div class="layui-form-item">
                    <label class="layui-form-label">缴费金额</label>
                    <div class="layui-input-block">
                        <input type="number" name="pay_amount" disabled value="{$info.pay_amount/100}" autocomplete="off"
                               placeholder="请输入需缴金额" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">缴费状态</label>
                    <div class="layui-input-block">
                        <input type="text" value="已缴费" disabled autocomplete="off" placeholder="请输入需缴金额"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">备注</label>
                    <div class="layui-input-block">
                        <textarea placeholder="请输入内容" disabled class="layui-textarea"
                                  name="remark">{$info.remark}</textarea>
                    </div>
                </div>
                {if condition="$info['type'] eq 1"}
                <div class="layui-form-item">
                    <label class="layui-form-label">退款去向*</label>
                    <div class="layui-input-inline">
                        <select name="refund_type">
                            <option value="">请选择</option>
                            <option value="1">退款至余额</option>
<!--                            <option value="2">线下退款</option>-->
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">退款理由</label>
                    <div class="layui-input-block">
                        <textarea placeholder="请输入退款理由" class="layui-textarea" name="refund_reason">{$info.refund_reason}</textarea>
                    </div>
                </div>
                {if condition="$info['pay_status'] neq -1"}
                <div class="layui-form-item layui-layout-admin " style="width: 100%">
                    <div class="layui-input-block">
                        <div class="layui-footer" style="left: 0px;text-align: center;">
                            <button class="layui-btn" lay-submit="" lay-filter="confirm">退款</button>
                        </div>
                    </div>
                </div>
                {/if}
                {/if}

                {else/}
                {if condition="$info['pay_status'] eq 0"}
                <div class="layui-form-item">
                    <label class="layui-form-label">缴费金额</label>
                    <div class="layui-input-block">
                        <input type="number" name="pay_amount" value="{$info.pay_amount/100}" autocomplete="off"
                               placeholder="请输入需缴金额" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">订单状态*</label>
                    <div class="layui-input-inline">
                        <select name="pay_status" lay-search="" lay-verify="required">
                            <option value="">请选择</option>
                            <option value="0">未支付</option>
                            <option value="1">已支付</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">备注</label>
                    <div class="layui-input-block">
                        <textarea placeholder="请输入内容" class="layui-textarea" name="remark">{$info.remark}</textarea>
                    </div>
                </div>
                <div class="layui-form-item layui-layout-admin " style="width: 100%">
                    <div class="layui-input-block">
                        <div class="layui-footer" style="left: 0px;text-align: center;">
                            <button class="layui-btn" lay-submit="" lay-filter="confirm">提交</button>
                        </div>
                    </div>
                </div>

                {/if}
                {if condition="$info['pay_status'] eq -1"}
                <div class="layui-form-item">
                    <label class="layui-form-label">缴费金额</label>
                    <div class="layui-input-block">
                        <input type="number" name="pay_amount" disabled value="{$info.pay_amount/100}" autocomplete="off"
                               placeholder="请输入需缴金额" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">缴费状态</label>
                    <div class="layui-input-block">
                        <input type="text" value="已退费" disabled autocomplete="off" placeholder="请输入需缴金额"
                               class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">退款去向</label>
                    <div class="layui-input-block">
                        {if condition="$info['refund_type'] eq 1"}
                        <input type="text" value="退款至余额" disabled autocomplete="off" placeholder="请输入需缴金额"
                               class="layui-input">
                        {else/}
                        <input type="text" value="线下退款" disabled autocomplete="off" placeholder="请输入需缴金额"
                               class="layui-input">
                        {/if}

                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">退款理由</label>
                    <div class="layui-input-block">
                        <textarea placeholder="请输入退款理由" disabled class="layui-textarea" name="refund_reason">{$info.refund_reason}</textarea>
                    </div>
                </div>
                {/if}
                {/if}
            </form>
        </div>
    </div>
</div>

{/block}

{block name="js"} <!--js处理区-->


<script>
    layui.use(['element', 'table', 'form', 'jquery', 'lucky', 'opTable'], function () {
        var element = layui.element;
        var form = layui.form;
        var $ = layui.jquery;
        var lucky = layui.lucky;
        var opTable = layui.opTable;
        var table = layui.table;
        form.render();
        form.on('submit(confirm)', function (data) {
            // console.log(data.field)
            lucky.FormSubmit("{:url('common/adminUpdateCost')}", data.field, true);
            return false;
        });
    });

</script>

{/block}
